home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / BlobMgr / Library Folder / SetProc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  1.2 KB  |  41 lines  |  [TEXT/KAHL]

  1. /* -------------------------------------------------------------------- */
  2. /*                        Blob Draw Proc Installation                        */
  3. /* -------------------------------------------------------------------- */
  4.  
  5. # include    "BlobMgr.h"
  6.  
  7.  
  8. /*
  9.  * Set a blob's draw procedure and regions.  This routine makes COPIES
  10.  * of the regions passed in, so the caller should dispose of the regions
  11.  * it passes in itself.
  12.  */
  13.  
  14. pascal void
  15. SetProcRgnBlob (BlobHandle b, BDrawProcPtr p, RgnHandle dragRgn, RgnHandle statRgn)
  16. {
  17.     DisposeBlobPic (b);                /* toss any pic the blob might have */
  18.     (**b).bPicProc.bDrawProc = p;    /* install drawing procedure */
  19.     ClearBlobFlags (b, bPicMask);    /* set blob type to proc blob */
  20.     SetBlobRgns (b, dragRgn, statRgn);
  21.     if (BlobEnabled (b))
  22.         DrawBlob (b, inFullBlob);
  23. }
  24.  
  25.  
  26. /*
  27.  * Set a blob's draw procedure and regions, where the regions are
  28.  * defined by rectangles.
  29.  */
  30.  
  31. pascal void
  32. SetProcRectBlob (BlobHandle b, BDrawProcPtr p, Rect *dragRect, Rect *statRect)
  33. {
  34.     DisposeBlobPic (b);                /* toss any pic the blob might have */
  35.     (**b).bPicProc.bDrawProc = p;    /* install drawing procedure */
  36.     ClearBlobFlags (b, bPicMask);    /* set blob type to proc blob */
  37.     SetBlobRects (b, dragRect, statRect);
  38.     if (BlobEnabled (b))
  39.         DrawBlob (b, inFullBlob);
  40. }
  41.